<div class="alert alert-warning alert-dismissable">
    <i class="fa fa-warning"></i>
    <b>注意!</b> 更多功能参数请编辑 <code>"<?php echo APPPATH_RAW; ?>\config\config.php"</code>
</div>

<?php if ($settings) { ?>
    <div class="box">
        <div class="box-header">

        </div>
        <div class="box-body">
            <?php echo form_open('', 'class="form-horizontal" role="form"'); ?>
            <?php foreach ($settings as $setting) { ?>
                <?php if ($setting->input_type == 'textarea') { ?>
                    <div class="form-group">
                        <label for="<?php echo $setting->setting_name; ?>"
                               class="col-sm-2 control-label"><?php echo $setting->setting_name; ?></label>

                        <div class="col-sm-10">
                            <textarea name="setting[<?php echo $setting->setting_seq_id; ?>]" class="form-control"
                                      id="<?php echo $setting->setting_key; ?>"><?php echo $setting->setting_value; ?></textarea>
                            <p class="help-block"><?php echo $setting->helpblock; ?></p>
                        </div>
                    </div>
                <?php } elseif ($setting->input_type == 'text') { ?>
                    <div class="form-group">
                        <label for="<?php echo $setting->setting_name; ?>"
                               class="col-sm-2 control-label"><?php echo $setting->setting_name; ?></label>

                        <div class="col-sm-10">
                            <input type="text" name="setting[<?php echo $setting->setting_seq_id; ?>]"
                                   class="form-control"
                                   value="<?php echo $setting->setting_value; ?>"
                                   id="<?php echo $setting->setting_key; ?>">
                            <p class="help-block"><?php echo $setting->helpblock; ?></p>
                        </div>
                    </div>
                <?php } elseif ($setting->input_type == 'number') { ?>
                    <div class="form-group">
                        <label for="<?php echo $setting->setting_name; ?>"
                               class="col-sm-2 control-label"><?php echo $setting->setting_name; ?></label>

                        <div class="col-sm-10">
                            <input type="number" name="setting[<?php echo $setting->setting_seq_id; ?>]"
                                   class="form-control"
                                   value="<?php echo $setting->setting_value; ?>"
                                   id="<?php echo $setting->setting_key; ?>">
                            <p class="help-block"><?php echo $setting->helpblock; ?></p>
                        </div>
                    </div>
                <?php } elseif ($setting->input_type == 'checkbox') { ?>
                    <div class="form-group">
                        <label for="<?php echo $setting->setting_name; ?>"
                               class="col-sm-2 control-label"><?php echo $setting->setting_name; ?></label>

                        <div class="col-sm-10">
                            <div class="checkbox c_r">
                                <label>
                                    <input
                                        type="checkbox" <?php echo set_checkbox('setting[' . $setting->setting_seq_id . ']', $setting->setting_value, ($setting->setting_value ? TRUE : FALSE)) ?>
                                        name="setting[<?php echo $setting->setting_seq_id; ?>]"
                                        value="TRUE"
                                        id="<?php echo $setting->setting_key; ?>">
                                        <?php echo $setting->helpblock; ?>
                                </label>
                            </div>
                        </div>
                    </div>
                <?php } ?>
            <?php } ?>
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">更新</button>
            </div>
            <div class="clearfix"></div>
            <?php echo form_close(); ?>
        </div>
    </div>

<?php } ?>
